selenium 您的连接不是私密连接的解决办法

您所在的位置:网站首页 google 你的连接不是私密连接 selenium 您的连接不是私密连接的解决办法

selenium 您的连接不是私密连接的解决办法

2023-11-16 03:48| 来源: 网络整理| 查看: 265

        一、问题描述

  用selenium启动浏览器时,chrome提示您的连接不是私密连接。

 

 二、解决方案

方案1:

在当前页面用键盘输入  thisisunsafe  ,不是在地址栏输入,就直接敲键盘就行了,页面即会自动刷新进入网页,亲测有效。

但是有更简单的方法,见方案2。

 

方案2:

(2)设置忽略ssl证书认证的错误,或者接收不信任的认证

  Chrome:

options.add_argument('ignore-certificate-errors') from selenium import webdriver options = webdriver.ChromeOptions() options.add_argument('ignore-certificate-errors') driver = webdriver.Chrome(chrome_options=options) driver.get('https://cacert.org/') driver.close()

 

  Firefox:

profile.accept_untrusted_certs = True from selenium import webdriver profile = webdriver.FirefoxProfile() profile.accept_untrusted_certs = True driver = webdriver.Firefox(firefox_profile=profile) driver.get('https://cacert.org/') driver.close()

 

  IE:

capabilities['acceptSslCerts'] = True from selenium import webdriver capabilities = webdriver.DesiredCapabilities().INTERNETEXPLORER capabilities['acceptSslCerts'] = True driver = webdriver.Ie(capabilities=capabilities) driver.get('https://cacert.org/') driver.close()

 

  

  

 

 

 



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3